#!/usr/bin/env bash

a=`uname  -a`

if [[ $a =~ "MINGW64" ]];then
    echo "Windows 平台暂时不支持,即使编译成功，也无法加载 *.so 动态链接库";
    echo "编译停止";
    exit;
fi


SHELL_FOLDER=$(dirname $(readlink -f "$0"))

if [ ! -d "${SHELL_FOLDER}/../bin/" ]; then
  mkdir ${SHELL_FOLDER}/../bin/
fi

echo "开始编译程序"
echo "当前路径：${SHELL_FOLDER}"
go build -o=${SHELL_FOLDER}/../bin/ao-iot ${SHELL_FOLDER}/../cmd/
